package com.recorder.myapplication.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;

/**
 * Created by Administrator on 2019/5/12.
 */

public class KeepActivity extends Activity {


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        System.out.println("启动KEEP ");

        //获取窗口
        Window window = getWindow();
        //设置右上角
        window.setGravity(Gravity.TOP | Gravity.RIGHT);
        //获取属性
        WindowManager.LayoutParams params = window.getAttributes();
        //宽高为1
        params.width = 1;
        params.height = 1;


        //位置
        params.x = 0;
        params.y = 0;
        window.setAttributes(params);
        KeepManager.getmInstance().setKeep(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        System.out.println("关闭Keep ");

    }
}
